-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat: add reasoning content toggle for assistant messages #2809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add reasoning content toggle for assistant messages #2809
Conversation
Add toggleable reasoning_content field for assistant role messages in the Agent block's messages input component. Features: - Added reasoning_content optional field to Message interface - Added '+ Reasoning' / 'β Reasoning' toggle button for assistant messages - Reasoning content field appears/hides based on toggle state - Auto-shows reasoning content when existing data contains reasoning_content - Full support for variable references, env vars, and all existing features - Maintains clean UI by showing field only when needed This enables users to add reasoning/thinking content separately from the main response content, useful for: - o1/o3 models with reasoning capabilities - Few-shot learning examples with chain-of-thought - Debugging and transparency in agent responses
Someone is attempting to deploy a commit to the Sim Team on Vercel.
A member of the Team first needs to authorize it.
Greptile SummaryAdds an optional
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant MessagesInput
participant State
participant Message
User->>MessagesInput: Click "+ Reasoning" button
MessagesInput->>State: toggleReasoningContent(index)
State->>State: Update showReasoningContent[index] = true
MessagesInput->>MessagesInput: Re-render with reasoning field visible
User->>MessagesInput: Enter reasoning content
MessagesInput->>Message: updateMessageReasoningContent(index, content)
Message->>Message: Update message.reasoning_content
Message->>State: setMessages(updatedMessages)
User->>MessagesInput: Click "β Reasoning" button
MessagesInput->>State: toggleReasoningContent(index)
State->>State: Update showReasoningContent[index] = false
Note over State,Message: reasoning_content data preserved
MessagesInput->>MessagesInput: Re-render with reasoning field hidden
|
Greptile found no issues!
From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section.
This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".
π― Overview
Adds a toggleable reasoning_content field for assistant role messages in the Agent block's messages input component.
β¨ Features
π¬ Use Cases
π Implementation Details
Modified File:
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/messages-input/messages-input.tsxChanges:
reasoning_content?: stringto Message interfaceCode Statistics:
β Testing
Tested locally with development server. All existing functionality preserved.
π Related
This feature enables better support for reasoning models like OpenAI's o1/o3 series, which separate thinking/reasoning from response content.